home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
comm
/
tcp
/
Amster.lha
/
Amster_Install
/
Rexx
/
AmsterReport.rexx
next >
Wrap
OS/2 REXX Batch file
|
2000-06-18
|
2KB
|
87 lines
/* Scans the Amster.shares file and gives a report on the statistics of
your library. Written by Roger Clark (kaedric@texas.net) 18-Jun-00 */
Options Results
Parse Arg ShareList
If ShareList = "" then Do
If ~show(L,"rexxreqtools.library") then Do
If ~addlib("rexxreqtools.library",0,-30,0) then Do
Say "Could not access the rexxreqtools.library!"
Exit 20
End
End
Dir = Pragma("D")
ShareList = rtfilerequest(Dir,"Amster.shares","Choose Share File",,,)
If Sharelist = "" then Exit
End
If ~Exists(ShareList) then Do
Say 'Unable to open your library file, 'ShareList' - Exiting'
Exit
End
NumSongs = 0
NumBytes = 0
NumBytesSent = 0
NumReq = 0
NumSecs = 0
TopSongs. = ""
TopSongs.0 = 0
TopReq = 0
Call Open(Out,"Con:20/20/550/300/Amster Library Statistics/Auto/Close/Wait","W")
Call Open(In,ShareList,'R')
Do Until EOF(In)
SongName = ""
MD5 = ""
Size = 0
Bitrate = ""
Frequency = ""
Play = 0
ReqCountFlag = ""
Requests = 0
Data = ReadLn(In)
If Length(Data) < 1 then Leave
Parse Var Data '"'SongName'"' MD5 Size Bitrate Frequency Play ReqCountFlag Requests
If Requests = "" then Requests = 0
NumSongs = NumSongs + 1
NumReq = NumReq + Requests
If Requests = TopReq then Do
TopSongs.0 = TopSongs.0 + 1
Y = TopSongs.0
TopSongs.Y = SongName
End
If Requests > TopReq then Do
TopReq = Requests
TopSongs. = ""
TopSongs.0 = 1
TopSongs.1 = SongName
End
NumBytesSent = NumBytesSent + (Size * Requests / 1024 / 1024)
NumBytesSent = ((NumBytesSent * 100) % 1) / 100
NumBytes = NumBytes + Size/1024/1024
NumBytes = ((NumBytes * 100) % 1) / 100
NumSecs = NumSecs + Play
Hours = NumSecs % 3600
Minutes = (NumSecs % 60) - (Hours * 60)
Seconds = NumSecs - (Hours * 3600) - (Minutes * 60)
Playtime = Hours":"Right("00"||Minutes,2)":"Right("00"||Seconds,2)
Call WriteLn(Out," Number of Shared Songs -=> "NumSongs)
Call WriteLn(Out," Total Megabytes Shared -=> "NumBytes)
Call WriteLn(Out," Number of Songs Uploaded -=> "NumReq)
Call WriteLn(Out," Total Megabytes Uploaded -=> "NumBytesSent)
Call WriteLn(Out," Total Playtime of Library -=> "Playtime)
Call WriteLn(Out,"A")
End
Call Close(In)
Call WriteLn(Out,"B")
If TopReq > 0 then Do
Call WriteLn(Out,"Top Requested Songs: "TopReq" Requests")
Do Loop = 1 to TopSongs.0
Call WriteLn(Out," "TopSongs.Loop)
End
End